import React from 'react';
import { SalaryTable } from '..';
import styles from './postForm.less';
import { useCityList } from '../../hooks';

export default ({ form }) => {
    const [, cityList] = useCityList({ codes: ['linecity'] });
    const [positionValue, setPositionValue] = React.useState();
    const p = form.getFieldValue('positionValue');
    React.useEffect(() => {
        if (p) setPositionValue(p);
    }, [p]);
    return (
        <>
            <div className={styles.formBlockTitle}>薪资参考</div>
            <div className={styles.salaryTableWrap}>
                <SalaryTable positionValue={positionValue} cityList={cityList} />
            </div>
        </>
    );
};
